package com.sky.config;

import com.sky.properties.QnOssProperties;
import com.sky.utils.QnOssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Slf4j
public class OssConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public  QnOssUtil qnOssUtil(QnOssProperties qnOssProperties){
        log.info("文件上传配置类的参数：{}",qnOssProperties.getBucketName());
        return new QnOssUtil(qnOssProperties);
    }
}
